home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib / tk / scale.man < prev    next >
Encoding:
Text File  |  1992-08-24  |  11.3 KB  |  424 lines

  1. '\"
  2. '\" Copyright 1990 Regents of the University of California
  3. '\" Permission to use, copy, modify, and distribute this
  4. '\" documentation for any purpose and without fee is hereby
  5. '\" granted, provided that this notice appears in all copies.
  6. '\" The University of California makes no representations about
  7. '\" the suitability of this material for any purpose.  It is
  8. '\" provided "as is" without express or implied warranty.
  9. '\" 
  10. '\" $Header: /user6/ouster/wish/man/RCS/scale.man,v 1.8 92/08/21 11:49:51 ouster Exp $ SPRITE (Berkeley)
  11. '/" 
  12. .\" The definitions below are for supplemental macros used in Sprite
  13. .\" manual entries.
  14. .\"
  15. .\" .HS name section [date [version]]
  16. .\"    Replacement for .TH in other man pages.  See below for valid
  17. .\"    section names.
  18. .\"
  19. .\" .AP type name in/out [indent]
  20. .\"    Start paragraph describing an argument to a library procedure.
  21. .\"    type is type of argument (int, etc.), in/out is either "in", "out",
  22. .\"    or "in/out" to describe whether procedure reads or modifies arg,
  23. .\"    and indent is equivalent to second arg of .IP (shouldn't ever be
  24. .\"    needed;  use .AS below instead)
  25. .\"
  26. .\" .AS [type [name]]
  27. .\"    Give maximum sizes of arguments for setting tab stops.  Type and
  28. .\"    name are examples of largest possible arguments that will be passed
  29. .\"    to .AP later.  If args are omitted, default tab stops are used.
  30. .\"
  31. .\" .BS
  32. .\"    Start box enclosure.  From here until next .BE, everything will be
  33. .\"    enclosed in one large box.
  34. .\"
  35. .\" .BE
  36. .\"    End of box enclosure.
  37. .\"
  38. .\" .VS
  39. .\"    Begin vertical sidebar, for use in marking newly-changed parts
  40. .\"    of man pages.
  41. .\"
  42. .\" .VE
  43. .\"    End of vertical sidebar.
  44. .\"
  45. .\" .DS
  46. .\"    Begin an indented unfilled display.
  47. .\"
  48. .\" .DE
  49. .\"    End of indented unfilled display.
  50. .\"
  51. '\"    # Heading for Sprite man pages
  52. .de HS
  53. .if '\\$2'cmds'       .TH \\$1 1 \\$3 \\$4
  54. .if '\\$2'lib'        .TH \\$1 3 \\$3 \\$4
  55. .if '\\$2'tcl'        .TH \\$1 3 \\$3 \\$4
  56. .if '\\$2'tk'         .TH \\$1 3 \\$3 \\$4
  57. .if t .wh -1.3i ^B
  58. .nr ^l \\n(.l
  59. .ad b
  60. ..
  61. '\"    # Start an argument description
  62. .de AP
  63. .ie !"\\$4"" .TP \\$4
  64. .el \{\
  65. .   ie !"\\$2"" .TP \\n()Cu
  66. .   el          .TP 15
  67. .\}
  68. .ie !"\\$3"" \{\
  69. .ta \\n()Au \\n()Bu
  70. \&\\$1    \\fI\\$2\\fP    (\\$3)
  71. .\".b
  72. .\}
  73. .el \{\
  74. .br
  75. .ie !"\\$2"" \{\
  76. \&\\$1    \\fI\\$2\\fP
  77. .\}
  78. .el \{\
  79. \&\\fI\\$1\\fP
  80. .\}
  81. .\}
  82. ..
  83. '\"    # define tabbing values for .AP
  84. .de AS
  85. .nr )A 10n
  86. .if !"\\$1"" .nr )A \\w'\\$1'u+3n
  87. .nr )B \\n()Au+15n
  88. .\"
  89. .if !"\\$2"" .nr )B \\w'\\$2'u+\\n()Au+3n
  90. .nr )C \\n()Bu+\\w'(in/out)'u+2n
  91. ..
  92. '\"    # BS - start boxed text
  93. '\"    # ^y = starting y location
  94. '\"    # ^b = 1
  95. .de BS
  96. .br
  97. .mk ^y
  98. .nr ^b 1u
  99. .if n .nf
  100. .if n .ti 0
  101. .if n \l'\\n(.lu\(ul'
  102. .if n .fi
  103. ..
  104. '\"    # BE - end boxed text (draw box now)
  105. .de BE
  106. .nf
  107. .ti 0
  108. .mk ^t
  109. .ie n \l'\\n(^lu\(ul'
  110. .el \{\
  111. .\"    Draw four-sided box normally, but don't draw top of
  112. .\"    box if the box started on an earlier page.
  113. .ie !\\n(^b-1 \{\
  114. \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  115. .\}
  116. .el \}\
  117. \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\l'|0u-1.5n\(ul'
  118. .\}
  119. .\}
  120. .fi
  121. .br
  122. .nr ^b 0
  123. ..
  124. '\"    # VS - start vertical sidebar
  125. '\"    # ^Y = starting y location
  126. '\"    # ^v = 1 (for troff;  for nroff this doesn't matter)
  127. .de VS
  128. .mk ^Y
  129. .ie n 'mc \s12\(br\s0
  130. .el .nr ^v 1u
  131. ..
  132. '\"    # VE - end of vertical sidebar
  133. .de VE
  134. .ie n 'mc
  135. .el \{\
  136. .ev 2
  137. .nf
  138. .ti 0
  139. .mk ^t
  140. \h'|\\n(^lu+3n'\L'|\\n(^Yu-1v\(bv'\v'\\n(^tu+1v-\\n(^Yu'\h'-|\\n(^lu+3n'
  141. .sp -1
  142. .fi
  143. .ev
  144. .\}
  145. .nr ^v 0
  146. ..
  147. '\"    # Special macro to handle page bottom:  finish off current
  148. '\"    # box/sidebar if in box/sidebar mode, then invoked standard
  149. '\"    # page bottom macro.
  150. .de ^B
  151. .ev 2
  152. 'ti 0
  153. 'nf
  154. .mk ^t
  155. .if \\n(^b \{\
  156. .\"    Draw three-sided box if this is the box's first page,
  157. .\"    draw two sides but no top otherwise.
  158. .ie !\\n(^b-1 \h'-1.5n'\L'|\\n(^yu-1v'\l'\\n(^lu+3n\(ul'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  159. .el \h'-1.5n'\L'|\\n(^yu-1v'\h'\\n(^lu+3n'\L'\\n(^tu+1v-\\n(^yu'\h'|0u'\c
  160. .\}
  161. .if \\n(^v \{\
  162. .nr ^x \\n(^tu+1v-\\n(^Yu
  163. \kx\h'-\\nxu'\h'|\\n(^lu+3n'\ky\L'-\\n(^xu'\v'\\n(^xu'\h'|0u'\c
  164. .\}
  165. .bp
  166. 'fi
  167. .ev
  168. .if \\n(^b \{\
  169. .mk ^y
  170. .nr ^b 2
  171. .\}
  172. .if \\n(^v \{\
  173. .mk ^Y
  174. .\}
  175. ..
  176. '\"    # DS - begin display
  177. .de DS
  178. .RS
  179. .nf
  180. .sp
  181. ..
  182. '\"    # DE - end display
  183. .de DE
  184. .fi
  185. .RE
  186. .sp .5
  187. ..
  188. .HS scale cmds
  189. .BS
  190. '\" Note:  do not modify the .SH NAME line immediately below!
  191. .SH NAME
  192. scale \- Create and manipulate scale widgets
  193. .SH SYNOPSIS
  194. \fBscale\fI \fIpathName \fR?\fIoptions\fR?
  195. .SH "STANDARD OPTIONS"
  196. .LP
  197. .nf
  198. .ta 4c 8c 12c
  199. .VS
  200. \fBactiveForeground\fR    \fBborderWidth\fR    \fBfont\fR    \fBorient\fR
  201. \fBbackground\fR    \fBcursor\fR    \fBforeground\fR    \fBrelief\fR
  202. .VE
  203. .fi
  204. .LP
  205. See the ``options'' manual entry for details on the standard options.
  206. .SH "WIDGET-SPECIFIC OPTIONS"
  207. .ta 4c
  208. .LP
  209. .nf
  210. Name:    \fBcommand\fR
  211. Class:    \fBCommand\fR
  212. Command-Line Switch:    \fB\-command\fR
  213. .fi
  214. .IP
  215. Specifies the prefix of a Tcl command to invoke whenever the value of
  216. the scale is changed interactively.  The actual command consists
  217. of this option followed by
  218. a space and a number.  The number indicates the new value of the
  219. scale.
  220. .LP
  221. .nf
  222. Name:    \fBfrom\fR
  223. Class:    \fBFrom\fR
  224. Command-Line Switch:    \fB\-from\fR
  225. .fi
  226. .IP
  227. Specifies the value corresponding to the left or top end of the
  228. scale.  Must be an integer.
  229. .LP
  230. .nf
  231. Name:    \fBlabel\fR
  232. Class:    \fBLabel\fR
  233. Command-Line Switch:    \fB\-label\fR
  234. .fi
  235. .IP
  236. Specifies a string to displayed  as a label for the scale.  For
  237. vertical scales the label is displayed just to the right of the
  238. top end of the scale.  For horizontal scales the label is displayed
  239. just above the left end of the scale.
  240. .LP
  241. .nf
  242. Name:    \fBlength\fR
  243. Class:    \fBLength\fR
  244. Command-Line Switch:    \fB\-length\fR
  245. .fi
  246. .IP
  247. .VS
  248. Specifies the desired long dimension of the scale in screen units
  249. (i.e. any of the forms acceptable to \fBTk_GetPixels\fR).
  250. .VE
  251. For vertical scales this is the scale's height;  for horizontal scales
  252. it is the scale's width.
  253. .LP
  254. .nf
  255. Name:    \fBshowValue\fR
  256. Class:    \fBShowValue\fR
  257. Command-Line Switch:    \fB\-showvalue\fR
  258. .fi
  259. .IP
  260. Specifies a boolean value indicating whether or not the current
  261. value of the scale is to be displayed.
  262. .LP
  263. .nf
  264. Name:    \fBsliderForeground\fR
  265. Class:    \fBsliderForeground\fR
  266. Command-Line Switch:    \fB\-sliderforeground\fR
  267. .fi
  268. .IP
  269. Specifies the color to use for drawing the slider under normal conditions.
  270. When the mouse is in the slider window then the slider's color is
  271. determined by the \fBactiveForeground\fR option.
  272. .LP
  273. .nf
  274. Name:    \fBsliderLength\fR
  275. Class:    \fBSliderLength\fR
  276. Command-Line Switch:    \fB\-sliderlength\fR
  277. .fi
  278. .IP
  279. .VS
  280. Specfies the size of the slider, measured in screen units along the slider's
  281. long dimension.  The value may be specified in any of the forms acceptable
  282. to \fBTk_GetPixels\fR.
  283. .LP
  284. .nf
  285. .VS
  286. Name:    \fBstate\fR
  287. Class:    \fBState\fR
  288. Command-Line Switch:    \fB\-state\fR
  289. .fi
  290. .IP
  291. Specifies one of two states for the scale:  \fBnormal\fR or \fBdisabled\fR.
  292. If the scale is disabled then the value may not be changed and the scale
  293. won't activate when the mouse enters it.
  294. .VE
  295. .LP
  296. .nf
  297. Name:    \fBtickInterval\fR
  298. Class:    \fBTickInterval\fR
  299. Command-Line Switch:    \fB\-tickinterval\fR
  300. .fi
  301. .IP
  302. Must be an integer value.  Determines the spacing between numerical
  303. tick-marks displayed below or to the left of the slider.  If specified
  304. as 0, then no tick-marks will be displayed.
  305. .LP
  306. .nf
  307. Name:    \fBto\fR
  308. Class:    \fBTo\fR
  309. Command-Line Switch:    \fB\-to\fR
  310. .fi
  311. .IP
  312. Specifies the value corresponding to the right or bottom end of the
  313. scale.  Must be an integer.  This value may be either less than or
  314. greater than the \fBfrom\fR option.
  315. .LP
  316. .nf
  317. Name:    \fBwidth\fR
  318. Class:    \fBWidth\fR
  319. Command-Line Switch:    \fB\-width\fR
  320. .fi
  321. .IP
  322. .VS
  323. Specifies the desired narrow dimension of the scale in screen units
  324. (i.e. any of the forms acceptable to \fBTk_GetPixels\fR).
  325. .VE
  326. For vertical scales this is the scale's width;  for horizontal scales
  327. this is the scale's height.
  328. .BE
  329.  
  330. .SH DESCRIPTION
  331. .PP
  332. The \fBscale\fR command creates a new window (given by the
  333. \fIpathName\fR argument) and makes it into a scale widget.
  334. Additional
  335. options, described above, may be specified on the command line
  336. or in the option database
  337. to configure aspects of the scale such as its colors, orientation,
  338. and relief.  The \fBscale\fR command returns its
  339. \fIpathName\fR argument.  At the time this command is invoked,
  340. there must not exist a window named \fIpathName\fR, but
  341. \fIpathName\fR's parent must exist.
  342. .PP
  343. A scale is a widget that displays a rectangular region and a
  344. small \fIslider\fR.  The rectangular region corresponds to a range
  345. of integer values (determined by the \fBfrom\fR and \fBto\fR options),
  346. and the position of the slider selects a particular integer value.
  347. The slider's position (and hence the scale's value) may be adjusted
  348. by clicking or dragging with the mouse as described in the BINDINGS
  349. section below.  Whenever the scale's value is changed, a Tcl
  350. command is invoked (using the \fBcommand\fR option) to notify
  351. other interested widgets of the change.
  352. .PP
  353. Three annotations may be displayed in a scale widget:  a label
  354. appearing at the top-left of the widget (top-right for vertical
  355. scales), a number displayed just underneath the slider
  356. (just to the left of the slider for vertical scales), and a collection
  357. of numerical tick-marks just underneath the current value (just to the left of
  358. the current value for vertical scales).  Each of these three
  359. annotations may be selectively enabled or disabled using the
  360. configuration options.
  361.  
  362. .SH "WIDGET COMMAND"
  363. .PP
  364. The \fBscale\fR command creates a new Tcl command whose
  365. name is \fIpathName\fR.  This
  366. command may be used to invoke various
  367. operations on the widget.  It has the following general form:
  368. .DS C
  369. \fIpathName option \fR?\fIarg arg ...\fR?
  370. .DE
  371. \fIOption\fR and the \fIarg\fRs
  372. determine the exact behavior of the command.  The following
  373. commands are possible for scale widgets:
  374. .TP
  375. \fIpathName \fBconfigure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?
  376. Query or modify the configuration options of the widget.
  377. If no \fIoption\fR is specified, returns a list describing all of
  378. the available options for \fIpathName\fR (see \fBTk_ConfigureInfo\fR for
  379. information on the format of this list).  If \fIoption\fR is specified
  380. with no \fIvalue\fR, then the command returns a list describing the
  381. one named option (this list will be identical to the corresponding
  382. sublist of the value returned if no \fIoption\fR is specified).  If
  383. one or more \fIoption\-value\fR pairs are specified, then the command
  384. modifies the given widget option(s) to have the given value(s);  in
  385. this case the command returns an empty string.
  386. \fIOption\fR may have any of the values accepted by the \fBscale\fR
  387. command.
  388. .TP
  389. \fIpathName \fBget\fR
  390. Returns a decimal string giving the current value of the scale.
  391. .TP
  392. \fIpathName \fBset\fR \fIvalue\fR
  393. This command is invoked to change the current value of the scale,
  394. and hence the position at which the slider is displayed.  \fIValue\fR
  395. gives the new value for the scale.
  396.  
  397. .SH BINDINGS
  398. .PP
  399. When a new scale is created, it is given the following initial
  400. behavior by default:
  401. .TP 20
  402. \fB<Enter>\fR
  403. Change the slider display to use \fBactiveForeground\fR instead of
  404. \fBsliderForeground\fR.
  405. .TP 20
  406. \fB<Leave>\fR
  407. Reset the slider display to use \fBsliderForeground\fR instead of
  408. \fBactiveForeground\fR.
  409. .TP 20
  410. \fB<ButtonPress-1>\fR
  411. Change the slider display so that the slider appears sunken rather
  412. than raised.  Move the slider (and adjust the scale's value)
  413. to correspond to the current mouse position.
  414. .TP 20
  415. \fB<Button1-Motion>\fR
  416. Move the slider (and adjust the scale's value) to correspond to
  417. the current mouse position.
  418. .TP 20
  419. \fB<ButtonRelease-1>\fR
  420. Reset the slider display so that the slider appears raised again.
  421.  
  422. .SH KEYWORDS
  423. scale, widget
  424.